package ch01.a19.Factory;


import ch01.a19.abstracts.Operation;
import ch01.a19.opers.OperationAdd;
import ch01.a19.opers.OperationDiv;
import ch01.a19.opers.OperationMul;
import ch01.a19.opers.OperationSub;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/13 17:44
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/13 17:44
 */
public class OperationFactory {
    public static Operation createOperate(char operate) {
        Operation operation = null;
        switch (operate) {
            case '+':
                operation = new OperationAdd();
                break;
            case '-':
                operation = new OperationSub();
                break;
            case '*':
                operation = new OperationMul();
                break;
            case '/':
                operation = new OperationDiv();
                break;
        }
        return operation;
    }
}
